package xiangmu.schoolpaper.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xiangmu.schoolpaper.mapper.TeacherIndexMapper;
import xiangmu.schoolpaper.pojo.DTO.PaperCount;
import xiangmu.schoolpaper.pojo.DTO.SumData;
import xiangmu.schoolpaper.pojo.DTO.TotalRatingCount;
import xiangmu.schoolpaper.service.TeacherIndexService;

import java.util.List;

@Service

public class TeacherIndexServiceImpl implements TeacherIndexService {

    @Autowired
    private TeacherIndexMapper teacherIndexMapper;
    @Override
    public SumData getSumData() {
        SumData sumData=new SumData();
        sumData.setPaperSum(teacherIndexMapper.getPaperSum());
        sumData.setTemplateSum(teacherIndexMapper.getTemplateSum());
        sumData.setPersonSum(teacherIndexMapper.getPersonSum());
        sumData.setQualifiedPersonSum(teacherIndexMapper.getQualifiedPersonSum());

        return sumData;
    }

    @Override

    public List<PaperCount> getPaperCount() {
        List<PaperCount> paperCount = teacherIndexMapper.getPaperCount();
        return paperCount;
    }

    @Override
    public List<TotalRatingCount> getTotalRatingCount(){
        List<TotalRatingCount> totalRatingCount=teacherIndexMapper.getTotalRatingCount();
        return totalRatingCount;
    }

}
